export function groupBy(list,fn){
  let groups =[]
  list.forEach(element => {
    let k = fn(element)
    var group=groups.find(g=>g.key==k)
    if(group==null){
      group={
        key:k,
        items:[]
      }
      groups.push(group)
    }
    group.items.push(element)
  });
  return groups
}